<?php
class Validation
{
    protected $layout_object;
    protected $required_fields;
    
    private function isEmailValid(){
        if(isset($this->required_fields['email'])){
            if(!preg_match("/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+$/", $this->required_fields['email']))
                $this->layout_object->required->email = "Invalid Email";
        }
    }
}